<?php

namespace App\Enums;

use App\Traits\EnumMethods;

enum DomainType: string
{
    use EnumMethods;

    case MIDDLE = 'm';

    case PLAYER = 'p';

    case RANK = 'r';

    case STORAGE = 's';

    case STATEMENT = 't';

    const TYPE_MAP = [
        self::MIDDLE->value => '活码域名',
        self::PLAYER->value => '选手域名',
        self::RANK->value => '排行榜域名',
        self::STORAGE->value => 'CDN域名',
        self::STATEMENT->value => '数据看板',
    ];

    const TYPE_LABEL = [
        self::MIDDLE->value => 'primary',
        self::PLAYER->value => 'success',
        self::RANK->value => 'warning',
        self::STORAGE->value => 'danger',
        self::STATEMENT->value => 'info',
    ];

    public function toString(): string
    {
        return self::TYPE_MAP[$this->value];
    }
}
